﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ConfApp.Models
{
    public class Slot
    {
        public int ID { get; set; }
        public string Type { get; set; }
        public byte StartHour { get; set; }
        public byte StartMinute { get; set; }
        public byte FinishHour { get; set; }
        public byte FinishMinute { get; set; }

        public DateTime Start
        {
            get
            {
                return new DateTime(2011, 10, Day.Index == 0 ? Time.FirstDay.Day : Time.SecondDay.Day, StartHour, StartMinute, 0);
            }
        }

        public DateTime Finish
        {
            get
            {
                return new DateTime(2011, 10, Day.Index == 0 ? 19 : 20, FinishHour, FinishMinute, 0);
            }
        }

        public Day Day { get; set; }

        public string ToTimeSpanString()
        {
            return Day.ID == -1 ? "" : string.Format("{0:00}:{1:00} - {2:00}:{3:00}",StartHour, StartMinute, FinishHour, FinishMinute);
        }

        public override string ToString()
        {
            return string.Format("[{0}] [{1}] {2:00}:{3:00}-{4:00}:{5:00}",
                ID, Day.ID, StartHour, StartMinute, FinishHour, FinishMinute);
        }
    }
}
